package com.kosam.commons.base.repository;

import org.springframework.data.jpa.repository.support.JpaEntityInformation;
import org.springframework.data.jpa.repository.support.JpaEntityInformationSupport;
import org.springframework.data.jpa.repository.support.SimpleJpaRepository;

import javax.persistence.EntityManager;
import java.io.Serializable;

/**
 * Created by tgx on 2017/2/17.
 */
public class RepositorySupportImpl<M, ID extends Serializable> extends SimpleJpaRepository<M, ID> implements RepositorySupport<M, ID> {

    private EntityManager entityManager;
    private JpaEntityInformation entityInformation;

    public RepositorySupportImpl(Class<M> domainClass, EntityManager em) {
        super(domainClass, em);
        this.entityInformation = JpaEntityInformationSupport.getEntityInformation(domainClass, em);
        this.entityManager = em;
    }
}
